package org.nstack.storage.backup.sftp;

import org.springframework.http.HttpMethod;
import org.nstack.header.message.APIParam;
import org.nstack.header.rest.RestRequest;
import org.nstack.header.storage.backup.APIAddBackupStorageMsg;


@RestRequest(
        path = "/backup-storage/sftp",
        method = HttpMethod.POST,
        responseClass = APIAddSftpBackupStorageEvent.class,
        parameterName = "params"
)
public class APIAddSftpBackupStorageMsg extends APIAddBackupStorageMsg {
    @APIParam(maxLength = 255, emptyString = false)
    private String hostname;
    @APIParam(maxLength = 255)
    private String username;
    @APIParam(maxLength = 255)
    private String password;
    @APIParam(numberRange = {1, 65535}, required = false)
    private int sshPort = 22;



    @Override
    public String getType() {
        return SftpBackupStorageConstant.SFTP_BACKUP_STORAGE_TYPE;
    }

    public String getHostname() {
        return hostname;
    }
    public void setHostname(String hostname) {
        this.hostname = hostname;
    }
    public String getUsername() {
        return username;
    }
    public void setUsername(String username) {
        this.username = username;
    }
    public String getPassword() {
        return password;
    }
    public void setPassword(String password) {
        this.password = password;
    }
    public int getSshPort() {
        return sshPort;
    }

    public void setSshPort(int sshPort) {
        this.sshPort = sshPort;
    }

 
    public static APIAddSftpBackupStorageMsg __example__() {
        APIAddSftpBackupStorageMsg msg = new APIAddSftpBackupStorageMsg();
        msg.setName("Sftp-Test");
        msg.setUrl("/data/sftp-data");
        msg.setHostname("192.168.1.8");
        msg.setUsername("admin");
        msg.setPassword("test1234");

        return msg;
    }

}
